<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class CreateOperationLog extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        if (!Schema::hasTable('operation_log')) {
            Schema::create('operation_log', function (Blueprint $table) {
                $table->increments('id');
                $table->unsignedInteger('business_id')->default(0)->comment('业务主题ID');
                $table->string('business_type', 64)->default('')->comment('业务名称');
                $table->text('business_body')->comment('操作内容');
                $table->integer('create_time')->nullable();
                $table->integer('update_time')->nullable();
            });
        }
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('operation_log');
    }
}
